<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Alexa Auto SDK: aace::audio::AudioOutput Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="aace-logo.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Alexa Auto SDK
   &#160;<span id="projectnumber">2.2.0</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><b>aace</b></li><li class="navelem"><b>audio</b></li><li class="navelem"><a class="el" href="classaace_1_1audio_1_1_audio_output.html">AudioOutput</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-types">Public Types</a> &#124;
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-static-attribs">Static Public Attributes</a> &#124;
<a href="classaace_1_1audio_1_1_audio_output-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">aace::audio::AudioOutput Class Reference<span class="mlabels"><span class="mlabel">abstract</span></span></div>  </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-types"></a>
Public Types</h2></td></tr>
<tr class="memitem:ad03cbdbbf172fd64a16c16b64d8a4b05"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classaace_1_1audio_1_1_audio_output.html#ad03cbdbbf172fd64a16c16b64d8a4b05">MutedState</a> { <br />
&#160;&#160;<a class="el" href="classaace_1_1audio_1_1_audio_output.html#ad03cbdbbf172fd64a16c16b64d8a4b05acd1ae4f9f957c14ebf6f0e57671dc020">MutedState::MUTED</a>, 
<br />
&#160;&#160;<a class="el" href="classaace_1_1audio_1_1_audio_output.html#ad03cbdbbf172fd64a16c16b64d8a4b05a760f8b47116ad0f3481f06d99b17e12c">MutedState::UNMUTED</a>
<br />
 }</td></tr>
<tr class="separator:ad03cbdbbf172fd64a16c16b64d8a4b05"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab1be1bc2a34898eba12b799787d908c5"><td class="memItemLeft" align="right" valign="top">using&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classaace_1_1audio_1_1_audio_output.html#ab1be1bc2a34898eba12b799787d908c5">MediaState</a> = aace::audio::AudioOutputEngineInterface::MediaState</td></tr>
<tr class="separator:ab1be1bc2a34898eba12b799787d908c5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3259653b849b84a183de95091860dd21"><td class="memItemLeft" align="right" valign="top">using&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classaace_1_1audio_1_1_audio_output.html#a3259653b849b84a183de95091860dd21">MediaError</a> = aace::audio::AudioOutputEngineInterface::MediaError</td></tr>
<tr class="separator:a3259653b849b84a183de95091860dd21"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a2e67f2223e68d842685da2f32f14d49d"><td class="memItemLeft" align="right" valign="top">virtual bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classaace_1_1audio_1_1_audio_output.html#a2e67f2223e68d842685da2f32f14d49d">prepare</a> (std::shared_ptr&lt; AudioStream &gt; stream, bool repeating)=0</td></tr>
<tr class="separator:a2e67f2223e68d842685da2f32f14d49d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac65040330bf053723e6ded2df6c2da88"><td class="memItemLeft" align="right" valign="top">virtual bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classaace_1_1audio_1_1_audio_output.html#ac65040330bf053723e6ded2df6c2da88">prepare</a> (const std::string &amp;url, bool repeating)=0</td></tr>
<tr class="separator:ac65040330bf053723e6ded2df6c2da88"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5318ee52ef7ec7216ede5d09b7099c80"><td class="memItemLeft" align="right" valign="top">virtual bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classaace_1_1audio_1_1_audio_output.html#a5318ee52ef7ec7216ede5d09b7099c80">play</a> ()=0</td></tr>
<tr class="separator:a5318ee52ef7ec7216ede5d09b7099c80"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a80a92aeb055e394e6661c43f9217c670"><td class="memItemLeft" align="right" valign="top">virtual bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classaace_1_1audio_1_1_audio_output.html#a80a92aeb055e394e6661c43f9217c670">stop</a> ()=0</td></tr>
<tr class="separator:a80a92aeb055e394e6661c43f9217c670"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab0a3cb1163e4a2b4fa6ed0fbb54bdc4e"><td class="memItemLeft" align="right" valign="top">virtual bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classaace_1_1audio_1_1_audio_output.html#ab0a3cb1163e4a2b4fa6ed0fbb54bdc4e">pause</a> ()=0</td></tr>
<tr class="separator:ab0a3cb1163e4a2b4fa6ed0fbb54bdc4e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a16da42e4ec758e6635ab01c01bd435e5"><td class="memItemLeft" align="right" valign="top">virtual bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classaace_1_1audio_1_1_audio_output.html#a16da42e4ec758e6635ab01c01bd435e5">resume</a> ()=0</td></tr>
<tr class="separator:a16da42e4ec758e6635ab01c01bd435e5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a04ff4005d0f36300bc54421906b89299"><td class="memItemLeft" align="right" valign="top">virtual int64_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classaace_1_1audio_1_1_audio_output.html#a04ff4005d0f36300bc54421906b89299">getPosition</a> ()=0</td></tr>
<tr class="separator:a04ff4005d0f36300bc54421906b89299"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2d621811ac53c6128ad435546ba964e7"><td class="memItemLeft" align="right" valign="top">virtual bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classaace_1_1audio_1_1_audio_output.html#a2d621811ac53c6128ad435546ba964e7">setPosition</a> (int64_t position)=0</td></tr>
<tr class="separator:a2d621811ac53c6128ad435546ba964e7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af0ee84c73cd22161c02497508556ee90"><td class="memItemLeft" align="right" valign="top">virtual int64_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classaace_1_1audio_1_1_audio_output.html#af0ee84c73cd22161c02497508556ee90">getDuration</a> ()=0</td></tr>
<tr class="separator:af0ee84c73cd22161c02497508556ee90"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9fc6bddf91b8365fbd134ce024e25dfa"><td class="memItemLeft" align="right" valign="top">virtual int64_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classaace_1_1audio_1_1_audio_output.html#a9fc6bddf91b8365fbd134ce024e25dfa">getNumBytesBuffered</a> ()</td></tr>
<tr class="separator:a9fc6bddf91b8365fbd134ce024e25dfa"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1a6e4c80146a448b4532f80f613dba11"><td class="memItemLeft" align="right" valign="top">virtual bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classaace_1_1audio_1_1_audio_output.html#a1a6e4c80146a448b4532f80f613dba11">volumeChanged</a> (float volume)=0</td></tr>
<tr class="separator:a1a6e4c80146a448b4532f80f613dba11"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a51ae5c98c56a0ed6328b1444d0aaf041"><td class="memItemLeft" align="right" valign="top">virtual bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classaace_1_1audio_1_1_audio_output.html#a51ae5c98c56a0ed6328b1444d0aaf041">mutedStateChanged</a> (<a class="el" href="classaace_1_1audio_1_1_audio_output.html#ad03cbdbbf172fd64a16c16b64d8a4b05">MutedState</a> state)=0</td></tr>
<tr class="separator:a51ae5c98c56a0ed6328b1444d0aaf041"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0159c40c50906ee017f1de903fc23590"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classaace_1_1audio_1_1_audio_output.html#a0159c40c50906ee017f1de903fc23590">mediaStateChanged</a> (<a class="el" href="classaace_1_1audio_1_1_audio_output.html#ab1be1bc2a34898eba12b799787d908c5">MediaState</a> state)</td></tr>
<tr class="separator:a0159c40c50906ee017f1de903fc23590"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5e4b3034d90818de56f925b227f2c2b7"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classaace_1_1audio_1_1_audio_output.html#a5e4b3034d90818de56f925b227f2c2b7">mediaError</a> (<a class="el" href="classaace_1_1audio_1_1_audio_output.html#a3259653b849b84a183de95091860dd21">MediaError</a> error, const std::string &amp;description=&quot;&quot;)</td></tr>
<tr class="separator:a5e4b3034d90818de56f925b227f2c2b7"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-attribs"></a>
Static Public Attributes</h2></td></tr>
<tr class="memitem:a6e6edf1cd19f4da033cfe3607d8872f3"><td class="memItemLeft" align="right" valign="top">static const int64_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classaace_1_1audio_1_1_audio_output.html#a6e6edf1cd19f4da033cfe3607d8872f3">TIME_UNKNOWN</a> = -1</td></tr>
<tr class="separator:a6e6edf1cd19f4da033cfe3607d8872f3"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p><a class="el" href="classaace_1_1audio_1_1_audio_output.html">AudioOutput</a> should be extended to play audio data provided by the Engine.</p>
<p>After returning <code>true</code> from a playback-controlling method invocation from the Engine (i.e. <code><a class="el" href="classaace_1_1audio_1_1_audio_output.html#a5318ee52ef7ec7216ede5d09b7099c80">play()</a></code>, <code><a class="el" href="classaace_1_1audio_1_1_audio_output.html#ab0a3cb1163e4a2b4fa6ed0fbb54bdc4e">pause()</a></code>, <code><a class="el" href="classaace_1_1audio_1_1_audio_output.html#a80a92aeb055e394e6661c43f9217c670">stop()</a></code>, <code><a class="el" href="classaace_1_1audio_1_1_audio_output.html#a16da42e4ec758e6635ab01c01bd435e5">resume()</a></code>), it is required that platform implementation notify the Engine of a playback state change by calling one of <code><a class="el" href="classaace_1_1audio_1_1_audio_output.html#a0159c40c50906ee017f1de903fc23590">mediaStateChanged()</a></code> with the new <code>MediaState</code> or <code><a class="el" href="classaace_1_1audio_1_1_audio_output.html#a5e4b3034d90818de56f925b227f2c2b7">mediaError()</a></code> with the <code>MediaError</code>. The Engine expects no call to <code><a class="el" href="classaace_1_1audio_1_1_audio_output.html#a0159c40c50906ee017f1de903fc23590">mediaStateChanged()</a></code> in response to an invocation for which the platform returned <code>false</code>.</p>
<p>The platform implementation may call <code><a class="el" href="classaace_1_1audio_1_1_audio_output.html#a5e4b3034d90818de56f925b227f2c2b7">mediaError()</a></code> or <code><a class="el" href="classaace_1_1audio_1_1_audio_output.html#a0159c40c50906ee017f1de903fc23590">mediaStateChanged()</a></code> with <code>MediaState::BUFFERING</code> at any time during a playback operation to notify the Engine of an error or buffer underrun, respectvely. When the media player resumes playback after a buffer underrun, the platform implementation should call <code><a class="el" href="classaace_1_1audio_1_1_audio_output.html#a0159c40c50906ee017f1de903fc23590">mediaStateChanged()</a></code> with <code>MediaState::PLAYING</code>.</p>
<dl class="section note"><dt>Note</dt><dd>The <code><a class="el" href="classaace_1_1audio_1_1_audio_output.html">AudioOutput</a></code> platform implementation should be able to support the audio formats recommended by AVS for a familiar Alexa experience: <a href="https://developer.amazon.com/docs/alexa-voice-service/recommended-media-support.html">https://developer.amazon.com/docs/alexa-voice-service/recommended-media-support.html</a> </dd></dl>
</div><h2 class="groupheader">Member Typedef Documentation</h2>
<a id="ab1be1bc2a34898eba12b799787d908c5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab1be1bc2a34898eba12b799787d908c5">&#9670;&nbsp;</a></span>MediaState</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">using aace::audio::AudioOutput::MediaState =  aace::audio::AudioOutputEngineInterface::MediaState</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Describes the playback state of the platform media player </p><dl class="section see"><dt>See also</dt><dd><code>aace::alexa::MediaPlayerEngineInterface::MediaState</code> </dd></dl>

</div>
</div>
<a id="a3259653b849b84a183de95091860dd21"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3259653b849b84a183de95091860dd21">&#9670;&nbsp;</a></span>MediaError</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">using aace::audio::AudioOutput::MediaError =  aace::audio::AudioOutputEngineInterface::MediaError</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Describes an error during a media playback operation </p><dl class="section see"><dt>See also</dt><dd><code>aace::alexa::MediaPlayerEngineInterface::MediaError</code> </dd></dl>

</div>
</div>
<h2 class="groupheader">Member Enumeration Documentation</h2>
<a id="ad03cbdbbf172fd64a16c16b64d8a4b05"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad03cbdbbf172fd64a16c16b64d8a4b05">&#9670;&nbsp;</a></span>MutedState</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="classaace_1_1audio_1_1_audio_output.html#ad03cbdbbf172fd64a16c16b64d8a4b05">aace::audio::AudioOutput::MutedState</a></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">strong</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="ad03cbdbbf172fd64a16c16b64d8a4b05acd1ae4f9f957c14ebf6f0e57671dc020"></a>MUTED&#160;</td><td class="fielddoc"><p>The audio channel state id muted. </p>
</td></tr>
<tr><td class="fieldname"><a id="ad03cbdbbf172fd64a16c16b64d8a4b05a760f8b47116ad0f3481f06d99b17e12c"></a>UNMUTED&#160;</td><td class="fielddoc"><p>The audio channel state id unmuted. </p>
</td></tr>
</table>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="a2e67f2223e68d842685da2f32f14d49d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2e67f2223e68d842685da2f32f14d49d">&#9670;&nbsp;</a></span>prepare() <span class="overload">[1/2]</span></h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual bool aace::audio::AudioOutput::prepare </td>
          <td>(</td>
          <td class="paramtype">std::shared_ptr&lt; AudioStream &gt;&#160;</td>
          <td class="paramname"><em>stream</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>repeating</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Notifies the platform implementation to prepare for playback of an <code>AudioStream</code> audio source. After returning <code>true</code>, the Engine will call <code><a class="el" href="classaace_1_1audio_1_1_audio_output.html#a5318ee52ef7ec7216ede5d09b7099c80">play()</a></code> to initiate audio playback.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">stream</td><td>The <code>AudioStream</code> object that provides the platform implementation audio data to play. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">repeating</td><td><code>true</code> if the platform should loop the audio when playing. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><code>true</code> if the platform implementation successfully handled the call, else <code>false</code> </dd></dl>

</div>
</div>
<a id="ac65040330bf053723e6ded2df6c2da88"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac65040330bf053723e6ded2df6c2da88">&#9670;&nbsp;</a></span>prepare() <span class="overload">[2/2]</span></h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual bool aace::audio::AudioOutput::prepare </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;&#160;</td>
          <td class="paramname"><em>url</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>repeating</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Notifies the platform implementation to prepare for playback of a URL audio source. After returning <code>true</code>, the Engine will call <code><a class="el" href="classaace_1_1audio_1_1_audio_output.html#a5318ee52ef7ec7216ede5d09b7099c80">play()</a></code> to initiate audio playback.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">url</td><td>The URL audio source to set in the platform media player </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">repeating</td><td><code>true</code> if the platform should loop the audio when playing. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><code>true</code> if the platform implementation successfully handled the call, else <code>false</code> </dd></dl>

</div>
</div>
<a id="a5318ee52ef7ec7216ede5d09b7099c80"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5318ee52ef7ec7216ede5d09b7099c80">&#9670;&nbsp;</a></span>play()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual bool aace::audio::AudioOutput::play </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Notifies the platform implementation to start playback of the current audio source. After returning <code>true</code>, the platform implementation must call <code><a class="el" href="classaace_1_1audio_1_1_audio_output.html#a0159c40c50906ee017f1de903fc23590">mediaStateChanged()</a></code> with <code>MediaState.PLAYING</code> when the media player begins playing the audio or <code><a class="el" href="classaace_1_1audio_1_1_audio_output.html#a5e4b3034d90818de56f925b227f2c2b7">mediaError()</a></code> if an error occurs.</p>
<dl class="section return"><dt>Returns</dt><dd><code>true</code> if the platform implementation successfully handled the call, else <code>false</code> </dd></dl>

</div>
</div>
<a id="a80a92aeb055e394e6661c43f9217c670"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a80a92aeb055e394e6661c43f9217c670">&#9670;&nbsp;</a></span>stop()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual bool aace::audio::AudioOutput::stop </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Notifies the platform implementation to stop playback of the current audio source. After returning <code>true</code>, the platform implementation must call <code><a class="el" href="classaace_1_1audio_1_1_audio_output.html#a0159c40c50906ee017f1de903fc23590">mediaStateChanged()</a></code> with <code>MediaState.STOPPED</code> when the media player stops playing the audio or immediately if it is already stopped, or <code><a class="el" href="classaace_1_1audio_1_1_audio_output.html#a5e4b3034d90818de56f925b227f2c2b7">mediaError()</a></code> if an error occurs. A subsequent call to <code><a class="el" href="classaace_1_1audio_1_1_audio_output.html#a5318ee52ef7ec7216ede5d09b7099c80">play()</a></code> will be preceded by calls to <code><a class="el" href="classaace_1_1audio_1_1_audio_output.html#a2e67f2223e68d842685da2f32f14d49d">prepare()</a></code> and <code><a class="el" href="classaace_1_1audio_1_1_audio_output.html#a2d621811ac53c6128ad435546ba964e7">setPosition()</a></code>.</p>
<dl class="section return"><dt>Returns</dt><dd><code>true</code> if the platform implementation successfully handled the call, else <code>false</code> </dd></dl>

</div>
</div>
<a id="ab0a3cb1163e4a2b4fa6ed0fbb54bdc4e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab0a3cb1163e4a2b4fa6ed0fbb54bdc4e">&#9670;&nbsp;</a></span>pause()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual bool aace::audio::AudioOutput::pause </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Notifies the platform implementation to pause playback of the current audio source. After returning <code>true</code>, the platform implementation must call <code><a class="el" href="classaace_1_1audio_1_1_audio_output.html#a0159c40c50906ee017f1de903fc23590">mediaStateChanged()</a></code> with <code>MediaState.STOPPED</code> when the media player pauses the audio or <code><a class="el" href="classaace_1_1audio_1_1_audio_output.html#a5e4b3034d90818de56f925b227f2c2b7">mediaError()</a></code> if an error occurs. A subsequent call to <code><a class="el" href="classaace_1_1audio_1_1_audio_output.html#a16da42e4ec758e6635ab01c01bd435e5">resume()</a></code> will not be preceded by calls to <code><a class="el" href="classaace_1_1audio_1_1_audio_output.html#a2e67f2223e68d842685da2f32f14d49d">prepare()</a></code> and <code><a class="el" href="classaace_1_1audio_1_1_audio_output.html#a2d621811ac53c6128ad435546ba964e7">setPosition()</a></code>.</p>
<dl class="section return"><dt>Returns</dt><dd><code>true</code> if the platform implementation successfully handled the call, else <code>false</code> </dd></dl>

</div>
</div>
<a id="a16da42e4ec758e6635ab01c01bd435e5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a16da42e4ec758e6635ab01c01bd435e5">&#9670;&nbsp;</a></span>resume()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual bool aace::audio::AudioOutput::resume </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Notifies the platform implementation to resume playback of the current audio source. After returning <code>true</code>, the platform implementation must call <code><a class="el" href="classaace_1_1audio_1_1_audio_output.html#a0159c40c50906ee017f1de903fc23590">mediaStateChanged()</a></code> with <code>MediaState.PLAYING</code> when the media player resumes the audio or <code><a class="el" href="classaace_1_1audio_1_1_audio_output.html#a5e4b3034d90818de56f925b227f2c2b7">mediaError()</a></code> if an error occurs.</p>
<dl class="section return"><dt>Returns</dt><dd><code>true</code> if the platform implementation successfully handled the call, else <code>false</code> </dd></dl>

</div>
</div>
<a id="a04ff4005d0f36300bc54421906b89299"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a04ff4005d0f36300bc54421906b89299">&#9670;&nbsp;</a></span>getPosition()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual int64_t aace::audio::AudioOutput::getPosition </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Returns the current playback position of the platform media player. If the audio source is not playing, the most recent position played should be returned.</p>
<dl class="section return"><dt>Returns</dt><dd>The platform media player's playback position in milliseconds, or <code>TIME_UNKNOWN</code> if the current media position is unknown or invalid. </dd></dl>

</div>
</div>
<a id="a2d621811ac53c6128ad435546ba964e7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2d621811ac53c6128ad435546ba964e7">&#9670;&nbsp;</a></span>setPosition()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual bool aace::audio::AudioOutput::setPosition </td>
          <td>(</td>
          <td class="paramtype">int64_t&#160;</td>
          <td class="paramname"><em>position</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Notifies the platform implementation to set the playback position of the current audio source in the platform media player.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">position</td><td>The playback position in milliseconds to set in the platform media player </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><code>true</code> if the platform implementation successfully handled the call, else <code>false</code> </dd></dl>

</div>
</div>
<a id="af0ee84c73cd22161c02497508556ee90"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af0ee84c73cd22161c02497508556ee90">&#9670;&nbsp;</a></span>getDuration()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual int64_t aace::audio::AudioOutput::getDuration </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Returns the duration of the current audio source. If the duration is unknown, then <code>TIME_UNKNOWN</code> should be returned.</p>
<dl class="section return"><dt>Returns</dt><dd>The duration of the current audio source in milliseconds, or <code>TIME_UNKNOWN</code>. </dd></dl>

</div>
</div>
<a id="a9fc6bddf91b8365fbd134ce024e25dfa"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9fc6bddf91b8365fbd134ce024e25dfa">&#9670;&nbsp;</a></span>getNumBytesBuffered()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">int64_t aace::audio::AudioOutput::getNumBytesBuffered </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Returns the amount of audio data buffered.</p>
<dl class="section return"><dt>Returns</dt><dd>the number of bytes of the audio data buffered, or 0 if it's unknown. </dd></dl>

</div>
</div>
<a id="a1a6e4c80146a448b4532f80f613dba11"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1a6e4c80146a448b4532f80f613dba11">&#9670;&nbsp;</a></span>volumeChanged()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual bool aace::audio::AudioOutput::volumeChanged </td>
          <td>(</td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>volume</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Notifies the platform implementation to set the volume of the output channel. The <code>volume</code> value should be scaled to fit the needs of the platform.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">volume</td><td>The volume to set on the output channel. <code>volume</code> is in the range [0,1]. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><code>true</code> if the platform implementation successfully handled the call, else <code>false</code> </dd></dl>

</div>
</div>
<a id="a51ae5c98c56a0ed6328b1444d0aaf041"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a51ae5c98c56a0ed6328b1444d0aaf041">&#9670;&nbsp;</a></span>mutedStateChanged()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual bool aace::audio::AudioOutput::mutedStateChanged </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classaace_1_1audio_1_1_audio_output.html#ad03cbdbbf172fd64a16c16b64d8a4b05">MutedState</a>&#160;</td>
          <td class="paramname"><em>state</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Notifies the platform implementation to apply a muted state has changed for the output channel</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">state</td><td>The muted state to apply to the output channel. <code><a class="el" href="classaace_1_1audio_1_1_audio_output.html#ad03cbdbbf172fd64a16c16b64d8a4b05acd1ae4f9f957c14ebf6f0e57671dc020">MutedState::MUTED</a></code> when the output channel be muted, <code><a class="el" href="classaace_1_1audio_1_1_audio_output.html#ad03cbdbbf172fd64a16c16b64d8a4b05a760f8b47116ad0f3481f06d99b17e12c">MutedState::UNMUTED</a></code> when unmuted </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><code>true</code> if the platform implementation successfully handled the call, else <code>false</code> </dd></dl>

</div>
</div>
<a id="a0159c40c50906ee017f1de903fc23590"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0159c40c50906ee017f1de903fc23590">&#9670;&nbsp;</a></span>mediaStateChanged()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void aace::audio::AudioOutput::mediaStateChanged </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classaace_1_1audio_1_1_audio_output.html#ab1be1bc2a34898eba12b799787d908c5">MediaState</a>&#160;</td>
          <td class="paramname"><em>state</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Notifies the Engine of an audio playback state change in the platform implementation. Must be called when the platform media player transitions between stopped and playing states.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">state</td><td>The new playback state of the platform media player </td></tr>
  </table>
  </dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classaace_1_1audio_1_1_audio_output.html#ab1be1bc2a34898eba12b799787d908c5">MediaState</a> </dd></dl>

</div>
</div>
<a id="a5e4b3034d90818de56f925b227f2c2b7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5e4b3034d90818de56f925b227f2c2b7">&#9670;&nbsp;</a></span>mediaError()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void aace::audio::AudioOutput::mediaError </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classaace_1_1audio_1_1_audio_output.html#a3259653b849b84a183de95091860dd21">MediaError</a>&#160;</td>
          <td class="paramname"><em>error</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const std::string &amp;&#160;</td>
          <td class="paramname"><em>description</em> = <code>&quot;&quot;</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Notifies the Engine of an error during audio playback</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">error</td><td>The error encountered by the platform media player during playback </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">description</td><td>A description of the error </td></tr>
  </table>
  </dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classaace_1_1audio_1_1_audio_output.html#a3259653b849b84a183de95091860dd21">MediaError</a> </dd></dl>

</div>
</div>
<h2 class="groupheader">Member Data Documentation</h2>
<a id="a6e6edf1cd19f4da033cfe3607d8872f3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6e6edf1cd19f4da033cfe3607d8872f3">&#9670;&nbsp;</a></span>TIME_UNKNOWN</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">const int64_t aace::audio::AudioOutput::TIME_UNKNOWN = -1</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Used when audio time is unknown or indeterminate. </p>

</div>
</div>
</div><!-- contents -->
<html>
  <body>
    <hr style="height:1px;border-width:0;color:gray;background-color:gray">
    <p style="text-align:left;">
      Alexa Auto SDK 2.2.0 - Copyright 2017-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
      <span style="float:right;">
        Licensed under the <a HREF=http://aws.amazon.com/apache2.0/>Apache License, Version 2.0</a>
      </span>
    </p>
  </body>
</html>
